package com.deepocean.service.impl;

import com.deepocean.dao.DeslimingScreenDao;
import com.deepocean.entity.DeslimingScreenCondition;
import com.deepocean.entity.DeslimingScreenEntity;
import com.deepocean.entity.DeslimingScreenInAndOut1Hour;
import com.deepocean.service.IDeslimingScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class DeslimingScreenServiceImpl implements IDeslimingScreenService {
    @Autowired
    private DeslimingScreenDao deslimingScreenDao;
    @Override
    public boolean add(DeslimingScreenEntity deslimingScreenEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        deslimingScreenEntity.setId(id);
        return deslimingScreenDao.add(deslimingScreenEntity);
    }

    @Override
    public DeslimingScreenInAndOut1Hour getInAndOutInHour(String deviceId) {
        return deslimingScreenDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<DeslimingScreenEntity> getDeslimingScreenByCondition(DeslimingScreenCondition deslimingScreenCondition) {
        return deslimingScreenDao.getDeslimingScreenByCondition(deslimingScreenCondition);
    }
}
